# 元组[索引]根据==索引下标==查找元素
# index()查找某个数据，如果数据存在返回对应的下标，否则报错，语法和列表、字符串的index方法相同
# count()统计某个数据在当前元组出现的次数
# len()统计元组中数据的个数

tuple1 = (1,2,3,4,5)
tuple2 = (1)
tuple3 = (1,)
print(type(tuple1)) # <class 'tuple'>
print(type(tuple2)) # ()会被当做运算符优先级()对待.
print(type(tuple3)) # <class 'tuple'>

season = ('春','夏','秋','冬','春')
print(season[0]) # 春
# print(season.index('夏季')) # ValueError: tuple.index(x): x not in tuple
print(season.index('夏')) # 1
print(season.count('春')) # 2

print(len(season)) # 5

# season[0] = '春季' # TypeError: 'tuple' object does not support item assignment
# del season[3]      #  TypeError: 'tuple' object doesn't support item deletion